<!DOCTYPE html>
<html>
<head>
    

    

    



    <meta charset="utf-8">
    
    
    
    
    <title>Anson&#39;s Blog | 种一棵树最好的时间在十年前，其次是现在。</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#3F51B5">
    
    
    <meta name="keywords" content="">
    <meta name="description" content="张宁乐,博客">
<meta property="og:type" content="website">
<meta property="og:title" content="Anson&#39;s Blog">
<meta property="og:url" content="http://yoursite.com/page/6/index.html">
<meta property="og:site_name" content="Anson&#39;s Blog">
<meta property="og:description" content="张宁乐,博客">
<meta property="og:locale" content="zh-CN">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Anson&#39;s Blog">
<meta name="twitter:description" content="张宁乐,博客">
    
        <link rel="alternate" type="application/atom+xml" title="Anson&#39;s Blog" href="/atom.xml">
    
    <link rel="shortcut icon" href="/img/favicon.ico">
    <link rel="stylesheet" href="//unpkg.com/hexo-theme-material-indigo@latest/css/style.css">
    <script>window.lazyScripts=[]</script>

    <!-- custom head -->
    

</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu"  >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/brand.jpg)">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="https://yscoder.github.io/img/face.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">张宁乐</h5>
          <a href="mailto:zhangningle2017@gmail.com" title="zhangningle2017@gmail.com" class="mail">zhangningle2017@gmail.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                归档
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                标签
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/about"  >
                <i class="icon icon-lg icon-user"></i>
                关于
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://github.com/ansonznl" target="_blank" >
                <i class="icon icon-lg icon-github"></i>
                Github
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">Anson&#39;s Blog</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header index-header">

    <div class="container fade-scale">
        <h1 class="title">Anson&#39;s Blog</h1>
        <h5 class="subtitle">
            
                种一棵树最好的时间在十年前，其次是现在。
            
        </h5>
    </div>

    


</header>

<div class="container body-wrap">

    <ul class="post-list">
    
        <li class="post-list-item fade">
            <article id="post-设置账户SSH"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2018-01-06 10:09:45" datetime="2018-01-06T02:09:45.000Z"  itemprop="datePublished">
2018-01-06
<!--2018-10-19 17:04:58-->
</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2018/01/06/设置账户SSH/">添加账户SSH （免密码上传）</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        SSH以前没有添加SSH时，每次上传博文都要输入一次账户和密码，异常麻烦，这次我吧博客部署了三个git托管的主流平台（Guthub/Coding/码云）那可是要输三次账户名和密码的，为了方便节省时间就在网上找了找关于ssh教程，奈何都不是很全面，遇见不少坑，今天自己爬完坑自己记录一下，下次万一用到还可以翻出来看看，

参考
配置SHH配置shh key是让本地git项目与远程的github建...
    

        <a href="/2018/01/06/设置账户SSH/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Hexo/">Hexo</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-移动端页面开发关键—尺寸和布局"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-12-29 19:06:01" datetime="2017-12-29T11:06:01.000Z"  itemprop="datePublished">
2017-12-29
<!--2018-10-19 17:59:50-->
</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/12/29/移动端页面开发关键—尺寸和布局/">移动端页面开发关键—尺寸和布局</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        尺寸在移动端页面，我用到的尺寸单位有em、rem、vw、px基本不用，但我会设置Dom根元素html字体大小为14px，一来方便em和rem的尺寸计算，二来14px是最常用的字体大小。

常规浏览器默认字体大小为16px，最小字体为12px。

em首先你要有这样一个基础的认知：

假如一个元素没有重设字体大小，那么它的字体大小会继承父级元素，如果父级也没有设置大小，那么依次类推一直追溯到b...
    

        <a href="/2017/12/29/移动端页面开发关键—尺寸和布局/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/CSS/">CSS</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/JavaScript/">JavaScript</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-js判断pc端和移动端"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-12-26 19:02:25" datetime="2017-12-26T11:02:25.000Z"  itemprop="datePublished">
2017-12-26
<!--2018-10-19 17:06:13-->
</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/12/26/js判断pc端和移动端/">js判断浏览设备</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        js判断浏览设备在移动端火热的web界，估计现在开发网站都会开发pc端和移动端吧？可是用户访问网站时怎么确定是访问网站刚刚好就是用户使用设备所匹配网站呢？我最近就打算做一个网站pc端+移动端的。刚好遇见这个问题就此记下来：很简单！还是使用万能的js来解决这个问题,一段代码搞定！12345&lt;script&gt;if(navigator.userAgent.match(/(iPhone|i...
    

        <a href="/2017/12/26/js判断pc端和移动端/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/HTML/">HTML</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/JavaScript/">JavaScript</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-使用Ajax请求数据"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-12-26 09:04:54" datetime="2017-12-26T01:04:54.000Z"  itemprop="datePublished">
2017-12-26
<!--2018-10-19 16:40:26-->
</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/12/26/使用Ajax请求数据/">使用Ajax请求数据</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        ajax的简单使用接触php和Mysql后就一直想学ajax,今天终于开始尝试了写一个小的ajax实现页面的局部刷新了。
什么是ajax？
AJAX 是一种在无需重新加载整个网页的情况下，能够更新部分网页的技术。AJAX = 异步 JavaScript 和 XML。AJAX 是一种用于创建快速动态网页的技术。通过在后台与服务器进行少量数据交换，AJAX 可以使网页实现异步更新。这意味着可以在...
    

        <a href="/2017/12/26/使用Ajax请求数据/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Ajax/">Ajax</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/JavaScript/">JavaScript</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/php/">php</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-Mysql笔记一"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-12-19 20:10:20" datetime="2017-12-19T12:10:20.000Z"  itemprop="datePublished">
2017-12-19
<!--2018-10-19 17:31:48-->
</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/12/19/Mysql笔记一/">Mysql常用命令</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        创建一个mysql表输入命令 连接mysql 数据库winpty mysql -uroot -p

建数据库语句create database name//创建 数据库   数据库名字

使用数据库use name//使用数据库 名字

创建表语句create table name (id int auto_increment,name varchar(15),age int,sex cha...
    

        <a href="/2017/12/19/Mysql笔记一/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/php/">php</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-php笔记之oop笔记一"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-12-18 19:42:02" datetime="2017-12-18T11:42:02.000Z"  itemprop="datePublished">
2017-12-18
<!--2017-12-18 19:37:51-->
</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/12/18/php笔记之oop笔记一/">php笔记之oop笔记一</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        php-oop(面向对象编程)oop的特点
php面向对象编程的特点：封装性、继承性、多态性
面向对象编程的优势：代码功能更加清晰，数据处理，用户登陆，内容呈现等各写成一个类，在页面中只需包含这些类、实例化对象，然后再用简洁的语句应用对象就行
类与对象关系：类就像一个人类的群体 我们从类中实例化一个对象 就像是制定一个人。面向对象程序的单位就是对象，但对象又是通过类的实例化出来的，所以我们首...
    

        <a href="/2017/12/18/php笔记之oop笔记一/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/php/">php</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-Swiper笔记一"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-12-18 09:55:20" datetime="2017-12-18T01:55:20.000Z"  itemprop="datePublished">
2017-12-18
<!--2017-12-18 20:11:31-->
</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/12/18/Swiper笔记一/">Swiper笔记一</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        Swiper常用于移动端动画Swiper是纯javascript打造的滑动特效插件，面向手机、平板电脑等移动终端。
Swiper能实现触屏焦点图、触屏Tab切换、触屏多图切换等常用效果。Swiper开源、免费、稳定、使用简单、功能强大，是架构移动终端网站的重要选择！Swiper个人理解为是封装很好的css3动画的库，有这非常强大简单易用的API任何一个web开发者都简单上手的一个移动端动画库...
    

        <a href="/2017/12/18/Swiper笔记一/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/CSS3/">CSS3</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Swiper/">Swiper</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-PHP笔记三"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-12-13 19:01:20" datetime="2017-12-13T11:01:20.000Z"  itemprop="datePublished">
2017-12-13
<!--2017-12-17 16:39:26-->
</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/12/13/PHP笔记三/">php笔记三</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        cookie和session 的关系和用法具体来说cookie机制采用的是在客户端保持状态的方案，而session机制采用的是在服务器端保持状态的方案。
cookiecookie 常用于识别用户。cookie 是服务器留在用户计算机中的小文件。每当相同的计算机通过浏览器请求页面时，它同时会发送 cookie。通过 PHP，您能够创建并取回 cookie 的值。新建一个cookie：12set...
    

        <a href="/2017/12/13/PHP笔记三/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/php/">php</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-PHP笔记二"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-12-08 08:34:03" datetime="2017-12-08T00:34:03.000Z"  itemprop="datePublished">
2017-12-08
<!--2017-12-17 16:39:21-->
</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/12/08/PHP笔记二/">php笔记二</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        PHP 全局变量 - 超全局变量PHP 中的许多预定义变量都是“超全局的”，这意味着它们在一个脚本的全部作用域中都可用。在函数或方法中无需执行 global $variable; 就可以访问它们。

超全局变量：123456789$GLOBALS$_SERVER$_REQUEST$_POST$_GET$_FILES$_ENV$_COOKIE$_SESSION
$GLOBALS[‘var’] ...
    

        <a href="/2017/12/08/PHP笔记二/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/php/">php</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-PHP笔记一"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-12-05 20:23:20" datetime="2017-12-05T12:23:20.000Z"  itemprop="datePublished">
2017-12-05
<!--2017-12-17 16:39:31-->
</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/12/05/PHP笔记一/">php笔记一</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        为什么学PHP？ 学web前端也有一年多了，真是一入前端深四海，不入坑不知道坑有多深。这一年来从html、css 到javascript、后来又学了jQuery、Bootstrap、Vue.js几个js框架。经过在老师的建议下学了php，而且自己想对这方面有更多的了解。

一、php是什么？

PHP（外文名:PHP: Hypertext Preprocessor，中文名：“超文本预处理器”...
    

        <a href="/2017/12/05/PHP笔记一/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/php/">php</a></li></ul>

    </div>
    
</article>

        </li>
    
    </ul>

    
<nav id="page-nav">
    <div class="inner">
    <a class="extend prev" rel="prev" href="/page/5/">上一页</a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/4/">4</a><a class="page-number" href="/page/5/">5</a><span class="page-number current">6</span><a class="page-number" href="/page/7/">7</a><a class="extend next" rel="next" href="/page/7/">下一页</a>
    </div>
</nav>


</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        站点总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        站点总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


        <p>
            
                <span><a href="/atom.xml" target="_blank" class="rss" title="rss"><i class="icon icon-lg icon-rss"></i></a></span>
            
            <span>博客内容遵循 <a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a></span>
        </p>
    </div>
    <div class="bottom">
        <p><span>张宁乐 &copy; 2017 - 2019</span>
            <span>
                
                Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a>
            </span>
			<span>
					Hosted by <a href="https://pages.coding.me" style="font-weight: bold">Coding Pages</a>
			  </span>
        </p>
    </div>
</footer>
<!-- <script>
(function(){
    var bp = document.createElement("script");
    var curProtocol = window.location.protocol.split(":")[0];
    if (curProtocol === "https") {
        bp.src = "https://zz.bdstatic.com/linksubmit/push.js";
    }
    else {
        bp.src = "http://push.zhanzhang.baidu.com/push.js";
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script> -->

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://yoursite.com/page/6/&title=Anson's Blog&pic=https://yscoder.github.io/img/face.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://yoursite.com/page/6/&title=Anson's Blog&source=张宁乐,博客" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://yoursite.com/page/6/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=Anson's Blog&url=http://yoursite.com/page/6/&via=http://yoursite.com" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://yoursite.com/page/6/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: false };


</script>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/main.min.js"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/search.min.js" async></script>






<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>





</body>
</html>
